function test(times) {
    return new Promise((resolve, reject) => {
        // let waitTime = Math.floor(Math.random() * 1000)
        let waitTime = 1000
        setTimeout(() => {
            console.log(times, waitTime, new Date())
            resolve(times)
            reject("error")
        }, waitTime)
        //等待1s后返回
    })
}
console.log(new Date());
(async () => {
    for (let i = 0; i < 10; i++) {
        await test(i)
    }
})()
console.log(new Date())
//node fetch should be the best example

